package com.nsgf.library.data.bean;

import java.text.DecimalFormat;
import java.util.List;

public class ProductDetailBean {

    private String id;
    private String name;
    private String introduction;
    private String description;
    private String categoryId;
    private String picUrl;
    private Boolean specType;
    private double price;
    private double marketPrice;
    private String stock;
    private String salesCount;
    private MerchantDetailDTO merchantDetail;
    private List<String> sliderPicUrls;
    private List<SkusDTO> skus;
    private List<String> deliveryTypeNames;
    private List<DeliveryTypeDTO> deliveryType;
    private List<GroupedPropertiesDTO> groupedProperties;
    private List<AllValueNameVosDTO> allValueNameVos;
    private List<String> groupedIndexList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }

    public Boolean isSpecType() {
        return specType;
    }

    public void setSpecType(Boolean specType) {
        this.specType = specType;
    }

    public String getPrice() {
        DecimalFormat df = new DecimalFormat("#####0.00");
        return "￥"+df.format(price/100);
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getMarketPrice() {
        DecimalFormat df = new DecimalFormat("#####0.00");
        return "市场价￥"+df.format(marketPrice/100);
    }

    public void setMarketPrice(double marketPrice) {
        this.marketPrice = marketPrice;
    }

    public String getStock() {
        return "库存："+stock;
    }

    public void setStock(String stock) {
        this.stock = stock;
    }

    public String getSalesCount() {
        return salesCount+"人付款";
    }

    public void setSalesCount(String salesCount) {
        this.salesCount = salesCount;
    }

    public MerchantDetailDTO getMerchantDetail() {
        return merchantDetail;
    }

    public void setMerchantDetail(MerchantDetailDTO merchantDetail) {
        this.merchantDetail = merchantDetail;
    }

    public List<String> getSliderPicUrls() {
        return sliderPicUrls;
    }

    public void setSliderPicUrls(List<String> sliderPicUrls) {
        this.sliderPicUrls = sliderPicUrls;
    }

    public List<SkusDTO> getSkus() {
        return skus;
    }

    public void setSkus(List<SkusDTO> skus) {
        this.skus = skus;
    }

    public List<String> getDeliveryTypeNames() {
        return deliveryTypeNames;
    }

    public String getDeliveryNames() {
        StringBuffer stringBuffer = new StringBuffer();
        for (String src :getDeliveryTypeNames()){
            stringBuffer.append(src);
        }
        return stringBuffer.toString();
    }

    public void setDeliveryTypeNames(List<String> deliveryTypeNames) {
        this.deliveryTypeNames = deliveryTypeNames;
    }

    public List<DeliveryTypeDTO> getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(List<DeliveryTypeDTO> deliveryType) {
        this.deliveryType = deliveryType;
    }

    public List<GroupedPropertiesDTO> getGroupedProperties() {
        return groupedProperties;
    }

    public void setGroupedProperties(List<GroupedPropertiesDTO> groupedProperties) {
        this.groupedProperties = groupedProperties;
    }

    public List<AllValueNameVosDTO> getAllValueNameVos() {
        return allValueNameVos;
    }

    public void setAllValueNameVos(List<AllValueNameVosDTO> allValueNameVos) {
        this.allValueNameVos = allValueNameVos;
    }

    public List<String> getGroupedIndexList() {
        return groupedIndexList;
    }

    public void setGroupedIndexList(List<String> groupedIndexList) {
        this.groupedIndexList = groupedIndexList;
    }

    public static class MerchantDetailDTO {
        private String tenantId;
        private String name;
        private String avatar;
        private String isTrader;

        public String getTenantId() {
            return tenantId;
        }

        public void setTenantId(String tenantId) {
            this.tenantId = tenantId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public String getIsTrader() {
            return isTrader;
        }

        public void setIsTrader(String isTrader) {
            this.isTrader = isTrader;
        }
    }

    public static class SkusDTO {
        private String id;
        private double price;
        private String marketPrice;
        private Object vipPrice;
        private String picUrl;
        private String stock;
        private String weight;
        private String volume;
        private String specLink;
        private List<PropertiesDTO> properties;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public String getMarketPrice() {
            return marketPrice;
        }

        public void setMarketPrice(String marketPrice) {
            this.marketPrice = marketPrice;
        }

        public Object getVipPrice() {
            return vipPrice;
        }

        public void setVipPrice(Object vipPrice) {
            this.vipPrice = vipPrice;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }

        public String getStock() {
            return stock;
        }
        public String getStockSrc() {
            return "库存："+stock;
        }

        public void setStock(String stock) {
            this.stock = stock;
        }

        public String getWeight() {
            return weight;
        }

        public void setWeight(String weight) {
            this.weight = weight;
        }

        public String getVolume() {
            return volume;
        }

        public void setVolume(String volume) {
            this.volume = volume;
        }

        public String getSpecLink() {
            return specLink;
        }

        public void setSpecLink(String specLink) {
            this.specLink = specLink;
        }

        public List<PropertiesDTO> getProperties() {
            return properties;
        }

        public void setProperties(List<PropertiesDTO> properties) {
            this.properties = properties;
        }

        public static class PropertiesDTO {
            private String propertyId;
            private String propertyName;
            private String valueId;
            private String valueName;

            public String getPropertyId() {
                return propertyId;
            }

            public void setPropertyId(String propertyId) {
                this.propertyId = propertyId;
            }

            public String getPropertyName() {
                return propertyName;
            }

            public void setPropertyName(String propertyName) {
                this.propertyName = propertyName;
            }

            public String getValueId() {
                return valueId;
            }

            public void setValueId(String valueId) {
                this.valueId = valueId;
            }

            public String getValueName() {
                return valueName;
            }

            public void setValueName(String valueName) {
                this.valueName = valueName;
            }
        }
    }

    public static class DeliveryTypeDTO {
        private String code;
        private String name;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static class GroupedPropertiesDTO {
        private String groupedName;
        private String groupedIndex;
        private List<ValueNameVosDTO> valueNameVos;

        public String getGroupedName() {
            return groupedName;
        }

        public void setGroupedName(String groupedName) {
            this.groupedName = groupedName;
        }

        public String getGroupedIndex() {
            return groupedIndex;
        }

        public void setGroupedIndex(String groupedIndex) {
            this.groupedIndex = groupedIndex;
        }

        public List<ValueNameVosDTO> getValueNameVos() {
            return valueNameVos;
        }

        public void setValueNameVos(List<ValueNameVosDTO> valueNameVos) {
            this.valueNameVos = valueNameVos;
        }

        public static class ValueNameVosDTO {
            private String valueName;
            private Object skuId;
            private String groupNumber;
            private String uniqueId;
            private Boolean selected;

            public String getValueName() {
                return valueName;
            }

            public void setValueName(String valueName) {
                this.valueName = valueName;
            }

            public Object getSkuId() {
                return skuId;
            }

            public void setSkuId(Object skuId) {
                this.skuId = skuId;
            }

            public String getGroupNumber() {
                return groupNumber;
            }

            public void setGroupNumber(String groupNumber) {
                this.groupNumber = groupNumber;
            }

            public String getUniqueId() {
                return uniqueId;
            }

            public void setUniqueId(String uniqueId) {
                this.uniqueId = uniqueId;
            }

            public Boolean isSelected() {
                return selected;
            }

            public void setSelected(Boolean selected) {
                this.selected = selected;
            }
        }
    }

    public static class AllValueNameVosDTO {
        private String valueName;
        private Object skuId;
        private String groupNumber;
        private String uniqueId;
        private Boolean selected;

        public String getValueName() {
            return valueName;
        }

        public void setValueName(String valueName) {
            this.valueName = valueName;
        }

        public Object getSkuId() {
            return skuId;
        }

        public void setSkuId(Object skuId) {
            this.skuId = skuId;
        }

        public String getGroupNumber() {
            return groupNumber;
        }

        public void setGroupNumber(String groupNumber) {
            this.groupNumber = groupNumber;
        }

        public String getUniqueId() {
            return uniqueId;
        }

        public void setUniqueId(String uniqueId) {
            this.uniqueId = uniqueId;
        }

        public Boolean isSelected() {
            return selected;
        }

        public void setSelected(Boolean selected) {
            this.selected = selected;
        }
    }
}
